<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <script>
    const obj = {
      a: 1,
      get value() {
        console.log(this === proxyObj) // false
        return this.a
      },
    }

    const proxyObj = new Proxy(obj, {
      get: function (obj, prop, receiver) {
        return obj[prop]
      },
      set: function (obj, prop, value, receiver) {
        obj[prop] = value
        return true
      },
    })

    const child = Object.setPrototypeOf({ a: 2 }, proxyObj)

    console.log(child)

    proxyObj.value // proxyObj => {a: 1}
    // proxyObj.a = 2 // proxyObj => {a: 2}
  </script>
</html>
